package torres.ability;

import java.util.List;

import torres.entity.Entity;

/**
 * @author Torres
 * NonActionAbility that makes Entities invisible to other Entities
 * 
 */
public class CreepAbility extends NonActionAbility {

	/**
	 * Creates a new CreepAbility
	 * @param name Name of CreepAbility
	 */
	public CreepAbility(String name, int id, List<Cost> costs) {
		super(name, id, costs);
	}

	/**
	 * Calls CreepAbility on the given Entity
	 * @see torres.ability.NonActionAbility#useAbility(torres.entity.Entity)
	 * @param e Entity using creep
	 */
	public void useAbility(Entity e) {
		if(e.isVisible()) {
			System.out.println("CreepAbility: You are now invisible");
			e.setInvisible();	
		}
		else {
			e.setVisible();
			System.out.println("CreepAbility: You are now visible");
		}
	}
}
